<template>
	<view v-if="isVerify" class="not-open">
		该功能暂未开通
	</view>
	<view v-else class="main-box">
		<view class="agreement-confirm-main-box" style="z-index: 99999999;" v-if="flags">
		
					<view class="agreement-confirm-boxs">
						<view class="" style="text-align: right;" @click="flags=false">
							<image src="https://web.78keji.cn/images/nangua/close.png" mode="widthFix" style="width: 40rpx;">
							</image>
						</view>
						<image src="https://web.78keji.cn/images/nangua/popups.png" mode="widthFix" style="width: 600rpx;">
						</image>
		
						<view class="" style="text-align: center;" @click="flags=false">
							<image src="https://web.78keji.cn/images/nangua/btn.png" mode="widthFix"
								style="width: 300rpx;margin-top: 10rpx;"></image>
						</view>
					</view>
		
		
		
				</view>
		<view>
			<image id="form-box" mode="widthFix" class="bg-image" src="https://web.78keji.cn/ngbg.png"></image>
			<view class="up">
				<view class="" style="text-align: center;font-size: 26rpx;padding-bottom: 20rpx;">
									次周起自动扣费：<text style="font-weight: bold;">29.9元/月</text><text style="color: #3867ED;cursor: pointer;"
										@click="flags=true">(可随时取消)</text>
								</view>
				<ng-up></ng-up>
			</view>
		
			<view class="index-all-content-box">
			
				<view class="main-form-box">
					

					<nanguas :mobile="formData.mobile" :param="formData.param" :submit="formData.submit"
						:baseImagePath="imagePath" ></nanguas>
				</view>
			</view>
			
		</view>


	</view>
</template>

<script>
	import httpUtil from "@/utils/httpUtil";
	import commonApi from "@/api/commonApi";
	import userApi from "@/api/userApi";
	import logApi from "../../api/logApi";
	import paramApi from "../../api/paramApi";

	export default {
		data() {
			return {
				flags:false,
				isVerify: false,
				scrollTop: 0,
				imagePath: 'https://h5.sx2b2c.com/images/pingzhi_shenghuo_dahuiyuan/zhifubao_mini/banpin/',
				scrollToTargetId: "form-box",
				formData: {
					mobile: '',
					param: '',
					submit: 0,
					intervalId: '',
				}
			}
		},
		onLoad(option) {
			this.initData(option)
			my.hideBackHome()
		},
		onPageScroll(e) {
			this.scrollTop = e.scrollTop
		},
		methods: {
			uuid() {
			    var s = [];
			    var hexDigits = "0123456789abcdef";
			    for (var i = 0; i < 36; i++) {
			        s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
			    }
			    s[14] = "4";  // bits 12-15 of the time_hi_and_version field to 0010
			    s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1);  // bits 6-7 of the clock_seq_hi_and_reserved to 01
			    s[8] = s[13] = s[18] = s[23] = "-";
			 
			    var uuid = s.join("");
				uni.setStorageSync('uuid', uuid)
			    return uuid;
			},
			initData(option) {
				// option.a = '123aaa'
				// option.param = "4"

				logApi.addLog('pzb_tcq option:' + JSON.stringify(option))
				paramApi.initData(option)

				this.initParam(option)
				commonApi.is404()

				if (!userApi.getUserId()) {
					userApi.initUserId()
				}
				if (option.submit) {
					this.formData.submit = option.submit
				}

				commonApi.isVerify(res => {
					this.isVerify = res
				})

				commonApi.buriedPoint(56)
			let paramx = {
				a: httpUtil.getA(),
				proCode:'LH2504',
				uuid:this.uuid()
			}
			// httpUtil.postReturnSource('/api/tongji/tongji0520', paramx)
			httpUtil.post('/api/tongji/tongji0520',paramx,res=>{
				
			})
			},
			initParam(option) {
				if (option.a) {
					httpUtil.setA(option.a)
				}
				if (option.param) {
					userApi.setParam(option.param)
				}
			}
		}
	}
</script>

<style lang="scss">
	.not-open {
		height: 100vh;
		display: flex;
		justify-content: center;
		align-items: center;
		color: #000;
	}

	.main-box {
		position: relative;
		    background: #ddebff;
		
		

		min-height: 100vh;
		
	}

	.main-form-box {
		width: 90%;
		// position: absolute;
		// left: 5%;
		// bottom: 10vh;
		margin: 10rpx auto 0;
	}

	.bg-image {
		width: 100%;
		height: auto;
	}

	.index-all-content-box {
	
	
	
		width: 100%;
	}

	.mobile-roll-left-box {
		position: relative;
	
	}
	.bottom{
	
		color: #FFFFFF;
		display: flex;
		justify-content: center;
		font-size: 22rpx;
		width: 100%;
	}
	.up{
		width: 100%;
		position: absolute;
		top:770rpx;
		padding: 0 55rpx;
	}
	.time{
		position: absolute;
		right: 50rpx;
		top: 1030rpx;
		width: 386rpx;
		font-size: 26rpx;
		text-align: center;
	}
	.agreement-confirm-main-box {
			position: fixed;
			left: 0;
			top: 0;
			width: 100vw;
			height: 100vh;
			display: flex;
			justify-content: center;
			align-items: center;
			background: url("https://qiming-1308147483.cos.ap-chengdu.myqcloud.com/doc%2Fpinzhi_shenghuo_huiyuan_quanyi%2Fcommon%2Flogin-shadow-bg.png") repeat;
			z-index: 2;
	
			.agreement-confirm-box {
				border-radius: 20rpx;
				background-color: #faf7f2;
				padding: 30rpx;
				width: 80%;
				box-sizing: border-box;
				padding: 63rpx 58rpx 38rpx;
	
				.title {
					font-size: 36rpx;
					font-family: PingFang SC;
					font-weight: bold;
					color: #000000;
					text-align: center;
				}
	
				.content {
					font-size: 28rpx;
					font-family: Source Han Sans CN;
					color: #000000;
					text-align: justify;
					margin-top: 61rpx;
					line-height: 45rpx;
	
					.tip {
						color: #DB202D;
					}
	
				}
	
				.submit-btn {
					height: 110rpx;
					// line-height: 110rpx;
					background: #51C78B;
					border-radius: 55rpx;
					margin-top: 52rpx;
					font-size: 32rpx;
					font-family: PingFang SC;
					font-weight: bold;
					color: #FFFFFF;
					text-align: center;
					display: flex;
					justify-content: center;
					align-items: center;
				}
	
				.cancel-btn {
					text-align: center;
					margin-top: 36rpx;
					font-size: 24rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #999999;
				}
			}
		}
</style>